﻿CREATE FUNCTION dbo.f_get_curID
	(
	@currencyName varchar(50)
	)
RETURNS int
AS
	BEGIN
	DECLARE @currencyID int
	SELECT @currencyID = ID FROM NSI_CURRENCY WHERE SHORT_NAME = @currencyName
	IF @currencyID IS NULL
	BEGIN
		SET @currencyID = -1;
	END
	
	RETURN @currencyID
	END